//
//  UIView+DXWFrame.m
//  BuDeJie
//
//  Created by 淡馨慰 on 16/8/6.
//  Copyright © 2016年 淡馨慰. All rights reserved.
//

#import "UIView+DXWFrame.h"

@implementation UIView (DXWFrame)

//快速获得x,y,width,height,centerX,centerY
- (void)setDxw_x:(CGFloat)dxw_x
{
    CGRect frame = self.frame;
    frame.origin.x = dxw_x; //将外界传进来的值赋给属性
    self.frame = frame; //将赋值好了的frame返回给frame属性
//    dxw_x = frame.origin.x;
}
- (CGFloat)dxw_x
{
    return self.frame.origin.x;
}
//--------------------------------
- (void)setDxw_y:(CGFloat)dxw_y
{
    CGRect frame = self.frame;
    frame.origin.y = dxw_y;
    self.frame = frame;
}
- (CGFloat)dxw_y
{
    return self.frame.origin.y;
}
//--------------------------------
- (void)setDxw_width:(CGFloat)dxw_width
{
    CGRect frame = self.frame;
    frame.size.width = dxw_width;
    self.frame = frame;
}
- (CGFloat)dxw_width
{
    return self.frame.size.width;
}
//--------------------------------
-(void)setDxw_height:(CGFloat)dxw_height
{
    CGRect frame = self.frame;
    frame.size.height = dxw_height;
    self.frame = frame;
}
- (CGFloat)dxw_height
{
    return self.frame.size.height;
}
//--------------------------------
- (void)setDxw_centerX:(CGFloat)dxw_centerX
{
    CGPoint center = self.center;
    center.x = dxw_centerX;
    self.center = center;
}
-(CGFloat)dxw_centerX
{
    return self.center.x;
}
//--------------------------------
-(void)setDxw_centerY:(CGFloat)dxw_centerY
{
    CGPoint center = self.center;
    center.y = dxw_centerY;
    self.center = center;
}
- (CGFloat)dxw_centerY
{
    return self.center.y;
}
//--------------------------------


@end
